home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-08-20 | 5.0 KB | 116 lines | [TEXT/ttxt] |
- Display Log Library
- Copyright © 1992-93, Apple Computer Inc. All Rights Reserved.
-
- Quick Reference Manual
- • Copy the LogLibrary shared library to the Extensions folder
- • Add the dcmd (in the DisplayLog file) to the MacsBug Debugger
- Prefs file.
- • Include LogLibrary.h in all applications/drivers/whatever that
- use the library.
- • Include LogLibrary.c in all 68000 modules.
- • Include the time conversion, time formatting, and data formatting
- functions in display applications.
- • See LogLibrary.h for function definitions.
-
- Edit History
- 93.11.06 MM Call StripAddress on the "high memory" location
- to prevent bogus string rejection.
- 93.12.06 MM
- • Edited Audit so it is a library of modules, rather
- than a single monolithic function. This gives a smaller
- memory footprint for drivers (etc.).
- • Bug: DisplayAudit never disposed of ancient strings
- and, consequently, would crash after about 6 hours.
- • After fixing the bug, I replaced LogManager by LogPane
- (roughly same functionality, but less handle thrashing).
- 94.07.18 MM
- • Now compiles for Power PC and 68000 using MPW,
- Think C 7.0 (68000), and MetroWerks 1.0 (68000 and
- Power PC). MPW builds a fat application.
- • Removed the 68000-specific interrupt disable code,
- replacing it by a simple semaphore. This permits the
- code to work in a fully native PPC environment. However,
- it also brings with it a extremely low risk of data loss that
- can only happen if multiple asynchronous processes attempt
- to log data at the same time. I judged that the advantage
- of working comfortably in a native environment outweighed
- the potential data loss.
- • Power PC (native) does not support the stack trace format
- operation.
- • The Build Audit AppleScript builds Think and MetroWerks
- versions. It is still a bit rough around the edges.
- 94.12.12 MM
- • Rewritten for PCI Power PC as a native application that
- uses the Driver Services and Name Registry capabilities.
- The driver library does not use the Macintosh Toolbox;
- this allows logging from new regime device drivers. The
- library is now called "DriverLog" The functions are
- generally compatible with Audit, but not totally so.
- 95.01.22 MM
- • Debugged and got mostly working as a shared library, fat app, and
- MacsBug dcmd. Known bugs:
- • Timing is incorrect. I'm pretty sure I know how to fix it, but this
- will require rebuilding the library and there are more pressing
- problems right now.
- • The dcmd has a few minor "off-by-one" errors.
-
- DisplayLog is a small library of functions that provide an unobtrusive
- event tracing capability to applications, drivers, code-resources,
- call-backs, and any other "flavor" of Macintosh software.
-
- The initialization function (MakeLogRecord) must be called from a
- "memory-safe" environment (i.e., MakeLogRecord may not be called from
- a driver interrupt routine), but all other functions may be called
- at any time.
-
- The MakeLogRecord functions are defined by comments in LogLibrary.h and
- LogLibrary.c A Microsoft Word 5.0 document, “About Log” documents the program.
-
- The Display Log application may be used to follow the execution
- of a program being audited. It can display auditing from several
- sources, and allows logging the audited data to a text file.
-
- The LogLibrary requires the following system facilities:
-
- • Driver Services Library
- • Name Registry Library
-
- The following are provided:
-
- • LogLibrary.h -- this header file must be included by all functions
- that use the DriverLog. It defines library structures and functions.
- • LogLibrary.c -- this file contains the C functions that support
- debugging. It is linked into all 68000 modules that need this support.
- (Linkage is needed to provide Mixed Mode glue). It is also provided as
- a shared library.
- • LogFormat.c contains a function to format driver log entries.
- It does not use the Macintosh toolbox. It is not in the shared library.
- • LogFormatTimestamp.c and LogConvertTimestamp.c provide functions
- to convert the timestamp provided in all log entries from "UpTime"
- format to civil time. A Macintosh Toolbox function is needed to form
- the DateTimeRec, hence these functions are not in the library.
- • MakeFile -- this MPW MakeFile builds the DriverLog DCMD and the
- DisplayDriverLog application.
- • LogDCMDSrc -- this folder contains a copy of the MacsBug dcmd support
- functions.
-
- Building:
-
- 1. Use the Makefile to build DisplayLog (this builds everything you need).
- 2. For MetroWerks, use the Makefile to build the MetroWerks resources,
- then use build the DisplayLog.µ 68000 application and, finally, the
- DisplayLog.Δ fat binary. Building a fat binary is overkill, but was useful
- in testing the application.
- 3. If you wish, use the DisplayLog.π project to build a Think C 68000
- variant (again, for testing).
- 4. Use Resedit to copy the 'dcmd' 20000 resource to the Debugger Prefs
- file (in the System File) and copy the LogLibrary shared library to
- the Extensions folder.
-
- Limitations and known bugs
-
- • Only MPW can build the dcmd.
- • Fractional seconds appear incorrect.
-
-
-